@extends('admin.base')


@section('content')
<!-- Content Header (Page header) -->
    <section class="content-header">
          <h1>
            订单信息管理表

          </h1>
          <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
            <li><a href="#">订单管理</a></li>
            
          </ol>
        </section>

        <!-- Main content -->
        <section class="content">
          <div class="row">
            <div class="col-md-12">
              <div class="box">
                <div class="box-header with-border">
                  <h3 class="box-title"><i class="fa fa-th"></i> 订单信息管理</h3>
                </div><!-- /.box-header -->
                <div class="box-body">
                  <table class="table table-bordered">
                    <tr>
                      <th style="width:60px">ID号</th>
                      <th>订单编号</th>
                      <th>用户名</th>
                      <th>商品信息</th>
                      <th>地址信息</th>
                      <th>总金额</th>
                      <th>订单状态</th>
                      <th>货品状态</th>
                      <th>添加时间</th>
                      <th style="width: 170px">操作</th>
                    </tr>
                    @foreach($list as $vo)
                        <tr>
                            <td>{{ $vo->id }}</td>
                            <td>{{ $vo->guid}}</td>
                            <td>{{ $vo->user_id}}</td>
                            <td>{{ $vo->cargo_message}}</td>
                            <td>{{ $vo->address_message}}</td>
                            <td>{{ $vo->total_amount}}</td>
                            <td>{{ $arr[$vo->order_status]}}</td>
                            <td>{{ $array[$vo->cargo_status]}}</td>
                            <td>{{ $vo->created_at}}</td>
                            <td>
                                <button class="btn btn-xs btn-primary" onclick="doDatail({{$vo->id}})" >订单详情 </button>
                                <a href="{{url('admin/orders/'.$vo->id.'/edit')}}"><button class="btn btn-xs btn-primary" >处理订单</button></a></td>

                        </tr>
                    @endforeach
                    
                  </table>
                </div><!-- /.box-body -->

              </div><!-- /.box -->

            </div><!-- /.col --> 
          </div><!-- /.row -->
        </section><!-- /.content -->
        
    @endsection
    
    
    <script type="text/javascript">
        function doDatail(id){
        //询问框
        layer.open({
            type: 1,
            skin: 'layui-layer-rim', //加上边框
            area: ['420px', '240px'], //宽高
            content: 'data'
        }), function(){
            $.post("{{url('admin/order_detail')}}/"+cate_id,{'_method':'index','_token':"{{csrf_token()}}"},function(data){
                if(data.status == 0){
                    location.href = location.href;
                    layer.msg(data.msg, {icon: 6});
                }else{
                    location.href = location.href;
                    layer.msg(data.msg, {icon: 5});
                }
            });

        };
    }
</script>
